<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <!--如果想在工具栏加入更多按钮，可以使用插槽方式， slot = 'left' or 'right'-->
      <!-- <crudOperation :permission="permission" /> -->
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <!-- <el-table-column type="selection" width="55" /> -->
        <el-table-column prop="serialNo" label="标签号" />
        <el-table-column prop="productNo" label="物料编号" />
        <el-table-column prop="productDescription" label="物料描述" />
        <el-table-column prop="partnerProductNo" label="客户物料编号" />
        <el-table-column prop="receiverName" label="客户" />
        <el-table-column prop="materialType" label="物料类型">
          <template slot-scope="scope">
            {{ dict.label.limitmaterial_type[scope.row.materialType] }}
          </template>
        </el-table-column>
        <el-table-column prop="quality" label="良品/不良品">
          <template slot-scope="scope">
            {{ dict.label.production_quality[scope.row.quality] }}
          </template>
        </el-table-column>
        <el-table-column prop="qty" label="数量" />
        <el-table-column prop="nb" label="箱数" />
        <el-table-column prop="netWeight" label="净重" />
        <el-table-column prop="weightUom" label="重量单位" />
        <el-table-column prop="creationDate" label="生产日期" />
        <el-table-column prop="containerType" label="容器类型" />
        <el-table-column prop="finishTime" label="完成时间" />
        <el-table-column prop="createTime" label="创建时间" />
        <el-table-column prop="currentStorageCode" label="当前储位编码" />
        <el-table-column prop="currentStorageType" label="当前储位库区类型" />
        <el-table-column prop="currentParentPalletCode" label="当前母托编码" />
        <!-- <el-table-column v-if="checkPer(['admin','moveWareHouseOrderDetail:edit','moveWareHouseOrderDetail:del'])" label="操作" width="150px" align="center">
          <template slot-scope="scope">
            <udOperation
              :data="scope.row"
              :permission="permission"
            />
          </template>
        </el-table-column> -->
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>

<script>
import crudMoveWareHouseOrderDetail from '@/api/work/moveOrderDetail'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
// import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'

const defaultForm = { id: null, moveWareHouseOrderId: null, serialNo: null, productNo: null, productDescription: null, partnerProductNo: null, receiverName: null, materialType: null, quality: null, qty: null, nb: null, netWeight: null, weightUom: null, creationDate: null, containerType: null, finishTime: null, updateTime: null, createTime: null, currentStorageCode: null, currentStorageType: null, currentParentPalletCode: null }
export default {
  name: 'MoveOrderDetail',
  components: { pagination },
  dicts: ['production_quality', 'limitmaterial_type'],
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: 'moveWareHouseOrderDetail', url: 'api/moveWareHouseOrderDetail', idField: 'id', sort: 'id,desc', crudMethod: { ...crudMoveWareHouseOrderDetail }})
  },
  data() {
    return {
      permission: {
        add: ['admin', 'moveWareHouseOrderDetail:add', 'otherUser'],
        edit: ['admin', 'moveWareHouseOrderDetail:edit', 'otherUser'],
        del: ['admin', 'moveWareHouseOrderDetail:del', 'otherUser']
      },
      rules: {}
    }
  },
  // created() {
  // },
  // mounted() {
  //   this.crud.toQuery()
  // },
  methods: {
    // 钩子：在获取表格数据之前执行，false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      this.query.moveWareHouseOrderId = this.$route.query.id
      return true
    }
  }
}
</script>

<style scoped>

</style>
